Repository navigation
Tests: per-backend test environments - #237
Merged
Merged
Conversation
…installed by the test runner) The test target installed CUDA, AMDGPU, Metal, Enzyme, KernelAbstractions and Polyester together on every platform, which held each GPU package back (CUDA 6.2.2, AMDGPU 2.7.0 on Julia 1.13) and has no solution on Julia pre. - test/Project.toml replaces the [extras]/[targets] test target; it holds only the always-needed test dependencies, no GPU package. - runtests.jl installs the backend given by PS_TEST_BACKEND (CUDA with CUDA_Runtime_jll, AMDGPU or Metal) into the temporary test environment of Pkg.test if it is not installed; the tests of that backend must then run. The CI jobs only set the variable. - test/packages.jl replaces the backend-selection preamble repeated in 18 test files; GPU packages that are not installed are replaced by empty placeholder modules, as the test files refer to the packages by name. - select_hardware tests: KernelAbstractions GPU backend types referred to qualified; test_allocators.jl: CellArrays type definitions selected with @static if; TEST_PACKAGES is a copy of SUPPORTED_PACKAGES instead of an alias. - Docs: Testing page updated. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…e GPU backend Pkg's automatic precompilation after Pkg.add fails with "Unknown package" for indirect dependencies whose version changed (GPUCompiler when adding AMDGPU), as it identifies them by name in the test environment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The test target installed CUDA, AMDGPU, Metal, Enzyme, KernelAbstractions and Polyester together on every platform. Resolving them jointly held each GPU package back (CUDA 6.2.2 and AMDGPU 2.7.0 on Julia 1.13, while 6.4.x and 2.9.x are released) and has no solution at all on the upcoming Julia release (
pre). Each CI job also downloaded the GPU packages it then skipped.Changes
test/Project.tomlreplaces the[extras]/[targets]test target. It holds only the always-needed test dependencies; the GPU packages are not among them.PS_TEST_BACKEND=CUDA|AMDGPU|Metalnow has two effects:runtests.jlinstalls the package (plusCUDA_Runtime_jllfor CUDA, so that a local CUDA runtime preference applies) into the temporary test environment ofPkg.testif it is not already there, and the tests of that backend must run. Without the variable, the CPU backends are tested. The CI jobs only set the variable, which they already did (CUDAon Daint,AMDGPUon Beverin,Metalon the macOS runners); the installation is repeated per run since the test environment is temporary, which is fast with a warm depot.test/packages.jl, included by every test file, replaces the backend-selection preamble that was repeated in 18 files. It imports the GPU packages that are installed, defines empty placeholder modules for the others (the test files refer to the packages by name, e.g.$package == $PKG_CUDAcompares the modules), and setsTEST_PACKAGESto the installed and functional ones.KernelAbstractionsGPU backend types are referred to qualified in theselect_hardwaretests (they only exist once the GPU package is loaded), theCellArraystype definitions intest_allocators.jlare selected with@static if, andTEST_PACKAGESis a copy ofSUPPORTED_PACKAGESinstead of an alias (the tests no longer mutate the package constant).PS_TEST_BACKENDand the optional permanentPkg.addinto the test environment.Effect
prejob should resolve again, since no job installs more than one GPU package (the conflict was between AMDGPU, CUDA and Enzyme together); to be confirmed by its run on this PR.